<template>
    <div class="favorites">
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <el-tab-pane label="公告标讯" name="公告标讯">
                <Screening :activeName="activeName" ref="scre" />
                <div style="margin-top: 15px;">
                    <el-table :data="tableData1" border style="width: 100%" :header-cell-style="{ 'text-align': 'center' }">
                        <el-table-column prop="date" label="公告类型" width="180" align="center" />
                        <el-table-column prop="name" label="标题信息" width="180" align="center" />
                        <el-table-column prop="address" label="所属行业" align="center" />
                        <el-table-column prop="address" label="收藏日期" align="center" />
                        <el-table-column prop="address" label="操作" />
                        <el-table-column prop="address" label="操作" align="center" width="120">
                            <template #default>
                                <el-button link type="primary" size="small" @click="handleClick">取消收藏</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-tab-pane>
            <el-tab-pane label="企业公司" name="企业公司">
                <Screening :activeName="activeName" ref="scre" />
                <div style="margin-top: 15px;">
                    <el-table :data="tableData2" border style="width: 100%" :header-cell-style="{ 'text-align': 'center' }">
                        <el-table-column prop="date" label="公司名称" width="180" align="center" />
                        <el-table-column prop="name" label="经营范围" width="180" align="center" />
                        <el-table-column prop="address" label="公司法人" align="center" />
                        <el-table-column prop="address" label="收藏日期" align="center" />
                        <el-table-column prop="address" label="操作" align="center" width="120">
                            <template #default>
                                <el-button link type="primary" size="small" @click="handleClick">取消收藏</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
  
<script setup>
import Screening from '../screening/index.vue'
import { ref } from 'vue'
// 暴露数据  
let scre = ref([])
const activeName = ref('公告标讯')
const handleClick = (tab) => {
    activeName.value = tab.props.name
    console.log(scre.value.assemble)
}
const tableData1 = [
    {
        date: '2016-05-03',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-02',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-04',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
]

const tableData2 = [
    {
        date: '2016-05-03',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-02',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-04',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
    {
        date: '2016-05-01',
        name: 'Tom',
        address: 'No. 189, Grove St, Los Angeles',
    },
]
</script>
  
<style lang="scss" scoped>
.favorites {
    height: 940px;
    padding: 20px;
    background-color: #fff;
}
</style>
  